package cn.dzhang.spring.boot.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.dzhang.spring.boot.remoting.BasicAuthenticationFilter;

@Configuration
public class WebConfig {
	@Autowired
	private BasicAuthenticationFilter authorizationFilter;
	
//	@Autowired
//	private SessionFactory sessionFactory;

	@Bean
	public FilterRegistrationBean authorizationFilter() {
		FilterRegistrationBean filter = new FilterRegistrationBean();
		filter.setFilter(authorizationFilter);
		return filter;

	}

	// @Bean
	// public OpenSessionInViewFilter openSessionInViewFilter() {
	// OpenSessionInViewFilter filter = new OpenSessionInViewFilter();
	// System.err.println(sessionFactory);
	// return filter;
	// }

}
